package com.it.xx.domian;

public class Subway {
    //定义地铁的编号
    private  String sid;
    //地铁站的名字
    private String sname;
    //地铁属于哪条线路
    private  String rout;

    @Override
    public String
    toString() {
        return "Subway{" +
                "sid='" + sid + '\'' +
                ", sname='" + sname + '\'' +
                ", rout='" + rout + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Subway subway = (Subway) o;

        if (sid != null ? !sid.equals(subway.sid) : subway.sid != null) return false;
        if (sname != null ? !sname.equals(subway.sname) : subway.sname != null) return false;
        return rout != null ? rout.equals(subway.rout) : subway.rout == null;
    }

    @Override
    public int hashCode() {
        int result = sid != null ? sid.hashCode() : 0;
        result = 31 * result + (sname != null ? sname.hashCode() : 0);
        result = 31 * result + (rout != null ? rout.hashCode() : 0);
        return result;
    }

    public String getSid() {
        return sid;
    }

    public void setSid(String sid) {
        this.sid = sid;
    }

    public String getSname() {
        return sname;
    }

    public void setSname(String sname) {
        this.sname = sname;
    }

    public String getRout() {
        return rout;
    }

    public void setRout(String rout) {
        this.rout = rout;
    }

    public Subway(String sid, String sname, String rout) {
        this.sid = sid;
        this.sname = sname;
        this.rout = rout;
    }

    public Subway() {
    }
}
